#include "Node.h"
#include <sstream>
#include "../../Commons/Utils.h"
using namespace Commons;
using namespace Tree;

Node::Node() {

	this->nodeNumber = -1;
	this->level = 0;
	this->recordNodes = new vector<RecordNode*> ();
}

bool Node::hasOverflow(unsigned int nodeMaxSize) {
	return getBufferSize() > nodeMaxSize;
}

bool Node::hasUnderflow() {
	return getRecordNodes()->size() == 0;
}

//getters and setters

unsigned int Node::getLevel() {
	return level;
}

vector<RecordNode*>* Node::getRecordNodes() {
	return recordNodes;
}

void Node::setLevel(unsigned int level) {
	this->level = level;
}

unsigned int Node::getEntityID() {
	return nodeNumber;
}

void Node::setEntityID(unsigned int entityID) {
	this->nodeNumber = entityID;
}

Node::~Node() {

	recordNodes->clear();
	delete recordNodes;
}
